package com.ryskoo.catering.dinnertable.service;

import com.ryskoo.catering.dinnertable.domain.DinnerTablePO;
import com.ryskoo.catering.dinnertable.repository.IDinnerTableRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;

@Service
public class DinnerTableServiceImpl extends BasicServiceImpl<DinnerTablePO> implements IDinnerTableService {

    @Autowired
    private IDinnerTableRepository dinnerTableRepository;

    @PostConstruct
    public void init(){
        this.setDao(dinnerTableRepository);
    }

    @Override
    public List<String> getUuidsByTypeUuid(String typeUuid) {
        return dinnerTableRepository.getUuidsByTypeUuid(typeUuid);
    }

    @Override
    public List<String> getUuidByNoAndVendorId(String no, String vendorId) {
        return dinnerTableRepository.getUuidByNoAndVendorId(no,vendorId);
    }

    @Override
    public List<String> getUuidByNoAndVendorIdForUpdate(String no, String vendorId, String uuid) {
        return dinnerTableRepository.getUuidByNoAndVendorIdForUpdate(no,vendorId,uuid);
    }

	@Override
	public void updateState(String uuid, String state) {
		dinnerTableRepository.updateState(uuid,state);
	}
    
    
}
